//
//  TraveMainCollectionViewCell.m
//  课余时间
//
//  Created by zgr on 16/4/8.
//  Copyright © 2016年 张大少. All rights reserved.
//

#import "TraveMainCollectionViewCell.h"
#import "UIView+SDAutoLayout.h"
#import "UIImageView+WebCache.h"
#import "UIColor+AddColor.h"
@interface TraveMainCollectionViewCell()
@property (nonatomic, strong)UIImageView *bacImg;
@property (nonatomic, strong)UILabel *name;
@end
@implementation TraveMainCollectionViewCell


-(instancetype)initWithFrame:(CGRect)frame
{
    if ( self = [super initWithFrame:frame]) {
        _bacImg = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, self.contentView.frame.size.width, self.contentView.frame.size.height)];
        _bacImg.layer.cornerRadius = 4;
        _name = [[UILabel alloc]initWithFrame:CGRectMake(10, 20, 120, 60)];
        _name.numberOfLines = 2;
        _name.textColor = [UIColor whiteColor];
        [self.contentView addSubview:_bacImg];
        [self.contentView addSubview:_name];
    }
    return self;
}

-(void)setCellWithModel:(TraveMainModel *)model
{
    [_bacImg sd_setImageWithURL:[NSURL URLWithString:model.image_url]];
    
    _name.text = [NSString stringWithFormat:@"%@ %@",model.name_zh_cn,model.name_en];
    
}
@end
